let validate = require('jsonschema').validate;

module.exports = function (instance, schema)
{
    try
    {
        validate(instance, schema, {
            throwFirst: true
        })
    } catch (err)
    {
        throw {
            msg: err.errors[0].toString()
        }
    }
}
